﻿$(function () {
    $(".go").bind("click", function () {
        console.log("这是我的毕业设计");
        var name = $(this).parent().find("input").eq(0).val();
        console.log(name);
        //取到当前页数
        //var ibianqian = $(this).parent().find("i").eq(0).text();
        //console.log(ibianqian);
        //取到总页数
        var ibianqia =parseInt($(this).parent().find("i").eq(1).text());
        console.log(ibianqia);
        //取到输入的值
        var page = parseInt($("#pageNow").val());
        console.log(page);
        if (page>=1 && page <= ibianqia)
        {
            window.location.href = "/shard/" + name + "/" + page;
        }
        else {
            alertwin("数据不合法","请输入正确的值");
        }
    })
    function alertwin(tilele, content) {
        $.alert({
            title: tilele,
            content: content,
            confirmButton: '确认',
            columnClass: 'col-md-4 col-md-offset-4',

        });
    }
})